//导入http模块
const http = require('http');

const server = http.createServer((request,response) => {
    //获得请求方法
    const method = request.method;
    //获得访问的路径
    const url = request.url;
    //获得http协议的版本
    const version = request.httpVersion;
    console.log(version);
    console.log(method);
    console.log(url);
    //获得请求头 默认是一个对象
    console.log( request.headers);
    response.end('hello');
});

server.listen(9000,() => {
    console.log('服务已启动 9000端口监听中....')
});